/**
 * Copyright (C) 2016 Juno Inc., All Rights Reserved.
 */
package com.jyl.designPattern.structure.proxy;

/**
 *
 * @author Long, E-mail:jyl0401@163.com
 * @date 2019年4月20日 下午5:38:16
 */
public class ProxyImage implements Image{

	private HighResolutionImage highResolutionImage;
	
	public ProxyImage(HighResolutionImage highResolutionImage){
		this.highResolutionImage = highResolutionImage;
	}
	
	public void showImage() {
		while(!highResolutionImage.isLoad()){
			try {
				System.out.println("Temp image "+highResolutionImage.getWidth()+highResolutionImage.getHigh());
				Thread.sleep(100);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		highResolutionImage.showImage();
	}

}
